//
//  User.m
//  weibo-OC
//
//  Created by diyuyma on 16/3/20.
//  Copyright © 2016年 zhangkaiyun. All rights reserved.
//

#import "User.h"

@interface User ()

@end

@implementation User

- (NSURL *)headImageURL {
    return [NSURL URLWithString:self.profile_image_url];
}

- (UIImage *)mbrankImage {
    if (self.mbrank > 0 && self.mbrank < 7) {
        return [UIImage imageNamed:[NSString stringWithFormat:@"common_icon_membership_level%ld", self.mbrank]];
    }
    return nil;
}

//- (void)setVerified_type:(NSInteger)verified_type {
////    verified_type = -1;
//    self.verified_type = verified_type;
//}

- (UIImage *)verified_type_Image {
    switch (self.verified_type) {
        case 0:
            return [UIImage imageNamed:@"avatar_vip"];
            break;
        case 2:
            return [UIImage imageNamed:@"avatar_enterprise_vip"];
            break;
        case 3:
            return [UIImage imageNamed:@"avatar_enterprise_vip"];
            break;
        case 4:
            return [UIImage imageNamed:@"avatar_enterprise_vip"];
            break;
        case 220:
            return [UIImage imageNamed:@"avatar_grassroot"];
            break;
        default:
            return nil;
    }
}

- (instancetype)initWithDict: (NSDictionary *)dict {
    self = [super init];
    [self setValuesForKeysWithDictionary:dict];
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
}

@end
